{% extends "manager/base.html" %}

{% block content %}
    <h2>增加数据: {{ table_desc }}</h2>
    
    <form method="post">
        {% csrf_token %}
        {% for field in fields %}
        <div class="mb-3">
            <label for="{{ field.0 }}" class="form-label">{{ field.0 }} ({{ field.1 }})</label>
            <input type="text" class="form-control" id="{{ field.0 }}" name="{{ field.0 }}" required>
        </div>
        {% endfor %}
        
        <button type="submit" class="btn btn-primary">保存</button>
        <a href="{% url 'table_detail' table_name=table_name %}" class="btn btn-secondary">取消</a>
    </form>
{% endblock %}